import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';

class RandomImageBg extends StatelessWidget {
  const RandomImageBg({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Opacity(
      opacity: 0.2,
      child: Image.network(
        "https://tenapi.cn/acg",
        height: MediaQuery.of(context).size.height,
        repeat: ImageRepeat.repeat,
      ),
    );
  }
}

class DefaultLoadingPage extends StatelessWidget {
  const DefaultLoadingPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
        child: Container(
      width: 100,
      height: 100,
      child: Lottie.asset('assets/loading.json'),
    ));
  }
}

class DefaultErrorPage extends StatelessWidget {
  const DefaultErrorPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Icon(Icons.error_rounded),
    );
  }
}
